package com.luo.backend.dto;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotEmpty;
import java.util.List;

/**
 * 创建订单请求DTO
 */
public class CreateOrderRequest {
    
    @NotNull(message = "商家ID不能为空")
    private Long merchantId;
    
    @NotNull(message = "地址ID不能为空")
    private Long addressId;
    
    private String scheduledDeliveryDate;
    private String scheduledDeliveryTime;
    
    @NotEmpty(message = "订单商品不能为空")
    private List<OrderItemRequest> items;
    
    private String notes;
    
    // 🆕 拼单活动ID（可选，用于关联拼单）
    private Long activityId;
    
    // 内部类 - 订单商品请求
    public static class OrderItemRequest {
        @NotNull(message = "商品ID不能为空")
        private Long foodId;
        
        @NotNull(message = "数量不能为空")
        private Integer quantity;
        
        private String spiceLevel;
        
        // Getters and Setters
        public Long getFoodId() { return foodId; }
        public void setFoodId(Long foodId) { this.foodId = foodId; }
        
        public Integer getQuantity() { return quantity; }
        public void setQuantity(Integer quantity) { this.quantity = quantity; }
        
        public String getSpiceLevel() { return spiceLevel; }
        public void setSpiceLevel(String spiceLevel) { this.spiceLevel = spiceLevel; }
    }
    
    // Getters and Setters
    public Long getMerchantId() {
        return merchantId;
    }
    
    public void setMerchantId(Long merchantId) {
        this.merchantId = merchantId;
    }
    
    public Long getAddressId() {
        return addressId;
    }
    
    public void setAddressId(Long addressId) {
        this.addressId = addressId;
    }
    
    public String getScheduledDeliveryDate() {
        return scheduledDeliveryDate;
    }
    
    public void setScheduledDeliveryDate(String scheduledDeliveryDate) {
        this.scheduledDeliveryDate = scheduledDeliveryDate;
    }
    
    public String getScheduledDeliveryTime() {
        return scheduledDeliveryTime;
    }
    
    public void setScheduledDeliveryTime(String scheduledDeliveryTime) {
        this.scheduledDeliveryTime = scheduledDeliveryTime;
    }
    
    public List<OrderItemRequest> getItems() {
        return items;
    }
    
    public void setItems(List<OrderItemRequest> items) {
        this.items = items;
    }
    
    public String getNotes() {
        return notes;
    }
    
    public void setNotes(String notes) {
        this.notes = notes;
    }
    
    public Long getActivityId() {
        return activityId;
    }
    
    public void setActivityId(Long activityId) {
        this.activityId = activityId;
    }
}

